<template>
  <div id="app">
     <button type='primary' @click="current()">
            hello {{per}}
    </button>
    <div>点击按钮手动更新</div>
  </div>
</template>

<script>
const { ipcRenderer,app } = require('electron');


  export default {
    name: 'electron_update',
    created(){
      this.$nextTick(()=>{
        // ipcRenderer.send('app-update', "")
        ipcRenderer.on('show-percent', (event, arg) => {
          console.log(arg) 
          this.per = arg 
        })

      })
    },
    data(){
      return {
        per:0
      }
    },
    methods:{
      current(){
         ipcRenderer.send('app-update', "123")
      }
      
    }
  }
</script>

<style>
  /* CSS */
</style>
